# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python-mox3
_pkgname=mox3
pkgver=1.1.0
pkgrel=10
arch=('any')
pkgdesc='Mock object framework for Python.'
url='https://docs.openstack.org/developer/mox3'
license=('Apache')
depends=('python-pbr' 'python-fixtures')
makedepends=('python-setuptools')
source=("https://github.com/openstack/mox3/archive/$pkgver.tar.gz")
sha512sums=('e531e0d5e61c7eca75733770a466d6bd5f451250c250c2ba7e751ba9a4e9fae24eb58e452687c3838b341fa0a87f56975b83c3a1164774969bea159719742d10')

export PBR_VERSION=$pkgver

prepare() {
  # Python 3.6 fixes
  sed -i 's/, flags=4//' "$_pkgname-$pkgver/mox3/tests/test_mox.py"
}

build() {
  cd "$_pkgname-$pkgver"

  python setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

